package com.aspose.cells.b.a.b;

import java.awt.Container;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.font.TextAttribute;
import java.util.Map;

public class zh {
   private static zh b;
   private static zh c;
   private static zh d;
   private static com.aspose.cells.b.a.b.d.za e = new com.aspose.cells.b.a.b.d.a.zb();
   public static Container a = new Container();
   private String f;
   private FontMetrics g;
   private int h;
   private Font i;

   zh() {
      this.g = null;
      this.h = 0;
   }

   zh(String var1, Font var2) {
      this.g = null;
      this.h = 0;
      this.f = var1;
      this.i = var2;
   }

   public static zh a() {
      return c;
   }

   public zh(String var1) {
      this(var1, e);
   }

   public zh(int var1) {
      this(g(var1));
   }

   public zh(String var1, com.aspose.cells.b.a.b.d.za var2) {
      this.g = null;
      this.h = 0;
      if (var1 == null) {
         throw new IllegalArgumentException("name can not be null");
      } else {
         if (var2 == null) {
            var2 = e;
         }

         if (var2.a(var1)) {
            this.f = var1;
         } else {
            this.f = g(1);
            var2 = e;
         }

         this.i = var2.b(this.f);
      }
   }

   public String b() {
      return this.f;
   }

   public int a(int var1) {
      return 571;
   }

   FontMetrics b(int var1) {
      if (this.h != var1 || this.g == null) {
         Map var2 = zg.a(this.i.getAttributes(), var1, true);
         var2.put(TextAttribute.SIZE, new Float(4096.0F));
         this.g = a.getFontMetrics(this.i.deriveFont(var2));
      }

      return this.g;
   }

   public int c(int var1) {
      return this.b(var1).getMaxAscent() >> 1;
   }

   public int d(int var1) {
      return this.b(var1).getMaxDescent() >> 1;
   }

   public int e(int var1) {
      return 2048;
   }

   public int f(int var1) {
      return this.b(var1).getHeight() >> 1;
   }

   public final Font c() {
      return this.i;
   }

   private static String g(int var0) {
      switch(var0) {
      case 0:
         return "Serif";
      case 1:
         return "SansSerif";
      default:
         return "Monospaced";
      }
   }

   static {
      e.a("Monospaced", new Font("Monospaced", 0, 10));
      e.a("SansSerif", new Font("SansSerif", 0, 10));
      e.a("Serif", new Font("Serif", 0, 10));
      b = new zh(2);
      c = new zh(1);
      d = new zh(0);
   }
}
